import axios from 'axios'
import store from "../store/index"
const Server = axios.create({
    baseURL:'',
    timeout:5000,
});
Server.interceptors.request.use(function(config){
    console.log(config)
    if(store.state.m_token.length>0){
        config.headers['Authorization']=store.state.m_token;
    }
    return config
},function(error){
    return Promise.reject(error);
})
Server.interceptors.response.use(function(response){
    return response.data
},function(error){
    return Promise.reject(error);
})

export default Server